#ifndef _SENSORS_H_
#define _SENSORS_H_

#include "lpc17xx_pinsel.h"

#define PORT_SENSORES	2

#define SENSOR1		(1<<0)
#define SENSOR2		(1<<1)
#define SENSOR3		(1<<2)
#define SENSOR4		(1<<3)
#define SENSOR5		(1<<4)
#define SENSOR6		(1<<5)

#define SENSORES	(SENSOR1|SENSOR2|SENSOR3|SENSOR4|SENSOR5|SENSOR6)

//Estrutura para controle de leitura de varios sensores
typedef struct{
	uint32_t s1:1;  //sensor6 da serigrafia -> S1  eh de fim de curso
	uint32_t s4:1;
	uint32_t s2:1;  //sensor8 da serigrafia -> S2
	uint32_t s3:1;  //sensor5 da serigrafia -> S3
	uint32_t s5:1;
	uint32_t s6:1;
	uint32_t resto:26;
}struct_sensores;

typedef union{
	uint32_t u32;
	struct_sensores input;
}union_sensor;

extern volatile union_sensor sensores;

void sensors_init (void);
uint16_t sensors_read (uint8_t xSensor);
void sensors_isr_read (void);



#endif
